package com.mvvm.start.base.utils

import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type

/**
 * @author
 * @功能: 解决Gson泛型擦除的问题
 * @Creat 12/22/20 9:42 AM
 * @Compony 465008238@qq.com
 */
class ParameterizedTypeImpl(var clazz: Class<*>) :
    ParameterizedType {
    override fun getActualTypeArguments(): Array<Type> {
        return arrayOf(clazz)
    }

    override fun getRawType(): Type {
        return MutableList::class.java
    }

    override fun getOwnerType(): Type? {
        return null
    }

}